<?php
class Userpages extends UaModel {
	var $name = "Userpage";
	var $current_li = null;
	var $keyword_condition = null;
	var $url_container = null;
	var $page_title = null;
	var $current_position = null;
	var $ualink_version = null;

	function getLi()
	{
		return $this->current_li;
	}

	function setLi($li_id)
	{
		
		switch ($li_id) {
			case 1:
				$this->current_li = "current_li_name_recruit";
				break;
			case 2:
				$this->current_li = "current_li_name_resume";
				break;
			case 3:
				$this->current_li = "current_li_name_onsite";
				break;
			case 4:
				$this->current_li = "current_li_name_company_hire";
				break;
			case 5:
				$this->current_li = "current_li_name_training";
				break;
      case 6:
				$this->current_li = "current_li_name_tips";
				break;
			case 7:
				$this->current_li = "current_li_name_policy";
				break;
			case 8:
				$this->current_li = "current_li_name_product_list";
				break;
			case 9:
				$this->current_li = "current_li_name_itinerary";
				break;

			case 20:
				$this->current_li = "current_li_name_hanguo";
				break;
			case 21:
				$this->current_li = "current_li_name_riben";
				break;
			case 22:
				$this->current_li = "current_li_name_gangao";
				break;
			case 23:
				$this->current_li = "current_li_name_dongnanya";
				break;
			case 24:
				$this->current_li = "current_li_name_nanya";
				break;
			case 25:
				$this->current_li = "current_li_name_feizhou";
				break;
			case 26:
				$this->current_li = "current_li_name_haidao";
				break;
			case 27:
				$this->current_li = "current_li_name_meizhou";
				break;
			case 28:
				$this->current_li = "current_li_name_ouzhou";
				break;
			case 29:
				$this->current_li = "current_li_name_guoneiyou";
				break;
			
      case 40:
				$this->current_li = "current_li_name_miyue";
				break;
      case 41:
				$this->current_li = "current_li_name_leling";
				break;
      case 42:
				$this->current_li = "current_li_name_youlun";
				break;
      case 43:
				$this->current_li = "current_li_name_qinzi";
				break;
      case 44:
				$this->current_li = "current_li_name_duanjiaqi";
				break;
      case 45:
				$this->current_li = "current_li_name_gaopinzhi";
				break;

      case 66:
				$this->current_li = "current_li_name_free_haidao";
				break;
      case 62:
				$this->current_li = "current_li_name_free_gangao";
				break;
      case 70:
				$this->current_li = "current_li_name_free_yazhou";
				break;
      case 67:
				$this->current_li = "current_li_name_free_meizhou";
				break;
      case 68:
				$this->current_li = "current_li_name_free_ouzhou";
				break;
      case 69:
				$this->current_li = "current_li_name_free_guonei";
				break;


      case 101:
				$this->current_li = "current_li_name_buy";
				break;
			case 102:
				$this->current_li = "current_li_name_sell";
				break;
			case 103:
				$this->current_li = "current_li_name_company";
				break;
			case 104:
				$this->current_li = "current_li_name_product";
				break;
			case 105:
				$this->current_li = "current_li_name_news";
				break;
      case 106:
				$this->current_li = "current_li_name_kuaibao";
				break;
			case 107:
				$this->current_li = "current_li_name_market";
				break;
			case 108:
				$this->current_li = "current_li_name_fair";
				break; 
      case 109:
				$this->current_li = "current_li_name_room";
				break;
			case 110:
				$this->current_li = "current_li_name_jishu";
				break;
			case 111:
				$this->current_li = "current_li_name_jiage";
				break;
      case 112:
				$this->current_li = "current_li_name_zhifu";
				break;
			case 113:
				$this->current_li = "current_li_name_zhengce";
				break;
      case 114:
				$this->current_li = "current_li_name_yicunyipin";
				break;
      case 115:
				$this->current_li = "current_li_name_free";
				break;
      case 116:
				$this->current_li = "current_li_name_visa";
				break;
      case 117:
				$this->current_li = "current_li_name_hotel";
				break;
      case 118:
				$this->current_li = "current_li_name_flight";
				break;
      case 200:
        $this->current_li = "current_li_name_cv_home";
        break;
      case 201:
        $this->current_li = "current_li_name_cv_cunwu";
        break;
      case 202:
        $this->current_li = "current_li_name_cv_cuncai";
        break;
      case 203:
        $this->current_li = "current_li_name_cv_xiangfeng";
        break;
      case 204:
        $this->current_li = "current_li_name_cv_cvshop";
        break;
      case 205:
        $this->current_li = "current_li_name_cv_cvhr";
        break;
      case 206:
        $this->current_li = "current_li_name_cv_xinghuo";
        break;
      case 207:
        $this->current_li = "current_li_name_cv_shequ";
        break;
      case 208:
        $this->current_li = "current_li_name_cv_qiye";
        break;
			default:
				$this->current_li = "current_li_name_start";
		}
	}

	function setUrlContainer($static_level){
		$tmp_contain = array();
		global $media_paths;
		$inc_path = $media_paths['INC_PATH'];
		switch ($static_level) {
			case 1:
				$tmp_contain['index'] = URL."index.html";
        $tmp_contain['recruit'] = URL."htmls/hr/recruit.html";
        $tmp_contain['resume'] = URL."htmls/hr/resume.html";
        $tmp_contain['onsite'] = URL."htmls/hr/onsite.html";
        $tmp_contain['company_hire'] = URL."htmls/hr/company_hire.html";
        $tmp_contain['training'] = URL."htmls/hr/training.html";
        $tmp_contain['tips'] = URL."htmls/hr/tips.html";
        $tmp_contain['policy'] = URL."htmls/hr/policy.html";
        $tmp_contain['logging'] = URL."user/logging.php";

        $tmp_contain['buy'] = URL."htmls/trade/buy-index.html";
				$tmp_contain['sell'] = URL."htmls/trade/sell-index.html";
				$tmp_contain['company'] = URL."htmls/company/index.html";
				$tmp_contain['product'] = URL."htmls/product/index.html";
				$tmp_contain['product_list'] = URL."htmls/product/list.html";
				$tmp_contain['news'] = URL."htmls/news/index.html";
        $tmp_contain['kuaibao'] = URL."htmls/kuaibao/index.html";
        $tmp_contain['zhifu'] = URL."htmls/zhifu/index.html";
        $tmp_contain['jishu'] = URL."htmls/jishu/index.html";
        $tmp_contain['jiage'] = URL."htmls/jiage/index.html";
        $tmp_contain['zhengce'] = URL."htmls/zhengce/index.html";
        $tmp_contain['yicunyipin'] = URL."htmls/yicunyipin/index.html";

				$tmp_contain['free'] = URL."htmls/free/index.html";
				$tmp_contain['free_list'] = URL."htmls/free/list.html";
				$tmp_contain['visa'] = URL."htmls/visa/index.html";
				$tmp_contain['hotel'] = URL."htmls/hotel/index.html";
				$tmp_contain['flight'] = URL."htmls/flight/index.html";
				
        $tmp_contain['common'] = URL;
				break;
			case 2:
				$tmp_contain['index'] = URL."index.html";
        $tmp_contain['recruit'] = URL."htmls/hr/recruit.html";
        $tmp_contain['resume'] = URL."htmls/hr/resume.html";
        $tmp_contain['onsite'] = URL."htmls/hr/onsite.html";
        $tmp_contain['company_hire'] = URL."htmls/hr/company_hire.html";
        $tmp_contain['training'] = URL."htmls/hr/training.html";
        $tmp_contain['tips'] = URL."htmls/hr/tips.html";
        $tmp_contain['policy'] = URL."htmls/hr/policy.html";
        $tmp_contain['logging'] = URL."user/logging.php";

        $tmp_contain['buy'] = URL."htmls/trade/buy-index.html";
				$tmp_contain['sell'] = URL."htmls/trade/sell-index.html";
				$tmp_contain['company'] = URL."htmls/company/index.html";
				$tmp_contain['product'] = URL."htmls/product/index.html";
				$tmp_contain['product_list'] = URL."htmls/product/list.html";
				$tmp_contain['news'] = URL."htmls/news/index.html";
        $tmp_contain['kuaibao'] = URL."htmls/kuaibao/index.html";
        $tmp_contain['zhifu'] = URL."htmls/zhifu/index.html";
        $tmp_contain['jishu'] = URL."htmls/jishu/index.html";
        $tmp_contain['jiage'] = URL."htmls/jiage/index.html";
        $tmp_contain['zhengce'] = URL."htmls/zhengce/index.html";
        $tmp_contain['yicunyipin'] = URL."htmls/yicunyipin/index.html";

				$tmp_contain['free'] = URL."htmls/free/index.html";
				$tmp_contain['free_list'] = URL."htmls/free/list.html";
				$tmp_contain['visa'] = URL."htmls/visa/index.html";
				$tmp_contain['hotel'] = URL."htmls/hotel/index.html";
				$tmp_contain['flight'] = URL."htmls/flight/index.html";
				
        $tmp_contain['common'] = URL;
				break;
			case 0:
				$tmp_contain['index'] = URL;
        $tmp_contain['recruit'] = URL."recruit/index.php";
        $tmp_contain['resume'] = URL."resume/index.php";
        $tmp_contain['onsite'] = URL."onsite/index.php";
        $tmp_contain['company_hire'] = URL."company_hire/index.php";
        $tmp_contain['training'] = URL."training/index.php";
        $tmp_contain['tips'] = URL."tips/index.php";
        $tmp_contain['policy'] = URL."policy/index.php";	
        $tmp_contain['logging'] = URL."user/logging.php";

        $tmp_contain['buy'] = URL."buy/index.php";
				$tmp_contain['sell'] = URL."sell/index.php";
				$tmp_contain['company'] = URL."company/index.php";
				$tmp_contain['product'] = URL."product/index.php";
				$tmp_contain['product_list'] = URL."product/list.php";
				$tmp_contain['news'] = URL."news/index.php";
        $tmp_contain['kuaibao'] = URL."kuaibao/index.php";
        $tmp_contain['zhifu'] = URL."zhifu/index.php";
        $tmp_contain['jishu'] = URL."jishu/index.php";
        $tmp_contain['jiage'] = URL."jiage/index.php";
        $tmp_contain['zhengce'] = URL."zhengce/index.php";
        $tmp_contain['yicunyipin'] = URL."yicunyipin/index.php";
        
				$tmp_contain['free'] = URL."free/index.php";
				$tmp_contain['free_list'] = URL."free/list.php";
				$tmp_contain['visa'] = URL."visa/index.php";
				$tmp_contain['hotel'] = URL."hotel/index.php";
				$tmp_contain['flight'] = URL."flight/index.php";
				
        $tmp_contain['common'] = URL;
				break;
			default:
				$tmp_contain['index'] = URL;
        $tmp_contain['recruit'] = URL."recruit/index.php";
        $tmp_contain['resume'] = URL."resume/index.php";
        $tmp_contain['onsite'] = URL."onsite/index.php";
        $tmp_contain['company_hire'] = URL."company_hire/index.php";
        $tmp_contain['training'] = URL."training/index.php";
        $tmp_contain['tips'] = URL."tips/index.php";
        $tmp_contain['policy'] = URL."policy/index.php";
        $tmp_contain['logging'] = URL."user/logging.php";

        $tmp_contain['buy'] = URL."buy/index.php";
				$tmp_contain['sell'] = URL."sell/index.php";
				$tmp_contain['company'] = URL."company/index.php";
				$tmp_contain['product'] = URL."product/index.php";
				$tmp_contain['product_list'] = URL."product/list.php";
				$tmp_contain['news'] = URL."news/index.php";
        $tmp_contain['kuaibao'] = URL."kuaibao/index.php";
        $tmp_contain['zhifu'] = URL."zhifu/index.php";
        $tmp_contain['jishu'] = URL."jishu/index.php";
        $tmp_contain['jiage'] = URL."jiage/index.php";
        $tmp_contain['zhengce'] = URL."zhengce/index.php";
        $tmp_contain['yicunyipin'] = URL."yicunyipin/index.php";

				$tmp_contain['free'] = URL."free/index.php";
				$tmp_contain['free_list'] = URL."free/list.php";
				$tmp_contain['visa'] = URL."visa/index.php";
				$tmp_contain['hotel'] = URL."hotel/index.php";
				$tmp_contain['flight'] = URL."flight/index.php";
				
        $tmp_contain['common'] = URL;
				break;
		}
		$this->url_container = $tmp_contain;
	}

	function getUrlContainer(){
		return $this->url_container;
	}

	function setUalinkVersion($xml_filename){
		$r = array();
		$rssurl = $xml_filename;
		$result = @file_get_contents($rssurl);
		if (empty($result) || !$result) {
			return  false;
		}
		$xml_parser = xml_parser_create("utf-8");
		xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
		xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,1);
		xml_parse_into_struct($xml_parser,$result,$values,$tags);
		xml_parser_free($xml_parser);
		array_pop($values);
		array_shift($values);
		foreach($values as $key=>$val){
			if($val['tag']=="public"){
				$r['public'] = array("ver"=>$val['attributes']['ver'], "build"=>$val['attributes']['build']);
			}elseif($val['tag']=="profession"){
				$r['profession'] = array("ver"=>$val['attributes']['ver'], "build"=>$val['attributes']['build']);
			}
		}
		unset($result);
		$this->ualink_version = $r;
	}

	function getUalinkVersion(){
		return $this->ualink_version;
	}
}
?>
